<template>
	<div>
		<el-dialog title="Alipay" :visible.sync="visible" width="50%" @close="onClose">
			<div style="margin-bottom: 20px;margin-top: -20px;"><el-alert title="请前往下载支付宝沙箱工具支付,链接:https://openhome.alipay.com/platform/appDaily.htm?tab=tool" type="warning" :closable="false"></el-alert></div>
			<el-form :model="dataForm" ref="dataForm" label-width="100px" size="small">
				<el-form-item label="支付金额" prop="amount">
					<el-input v-model="dataForm.amount" placeholder="支付金额" style="width: 90%;"></el-input>
				</el-form-item>
				<el-form-item label="支付信息" prop="message">
					<el-input v-model="dataForm.message" placeholder="支付信息" style="width: 90%;"></el-input>
				</el-form-item>
			</el-form>
			<span slot="footer" class="dialog-footer">
				<el-button type="primary" @click="dataFormSubmit()" size="small">确定</el-button>
				<el-button @click="visible = false" size="small">取消</el-button>
			</span>
		</el-dialog>
	</div>
</template>

<script>
	import {doAlipayCheckParam} from '@/api/alipay/alipay.js'
	export default{
		data(){
			return {
				dataForm:{},
				visible:false,
				
			}
		},
		methods:{
			init(){
				this.visible=true
			},
			onClose(){
				this.dataForm={}
			},
			dataFormSubmit(){
				doAlipayCheckParam(this.dataForm.amount,this.dataForm.message).then(data=>{
					if(data.code=="0000"){
						window.open("http://49.232.55.114:9001/alipay/doAlipay?amount="+this.dataForm.amount+"&message="+this.dataForm.message)
						this.visible=false
					}else{
						this.$message.error(data.msg)
					}
				})
			}
		}
	}
</script>

<style>
</style>
